file chooser: Don't select in the search entry
authorMatthias Clasen <mclasen@redhat.com>
Fri, 2 Oct 2015 02:59:57 +0000 (22:59 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 2 Oct 2015 02:59:57 +0000 (22:59 -0400)
The stack calls gtk_widget_grab_focus on the last focus widget,
which selects the text in the entry, so we need to make sure to
move the focus there first to keep that from happening.

https://bugzilla.gnome.org/show_bug.cgi?id=755931

gtk/gtkfilechooserwidget.c

index d286fcf08644556f9c71dd1beadca39420049353..1ea94b29bd468b3fb4230af7dd915c4684d08891 100644 (file)
@@ -3128,11 +3128,11 @@ operation_mode_set_search (GtkFileChooserWidget *impl)
       gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
     }
 
+  gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search_entry));
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "search");
   gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), TRUE);
   location_bar_update (impl);
   search_setup_widgets (impl);
-  gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search_entry));
   gtk_widget_set_sensitive (priv->filter_combo, FALSE);
 }